<template>
  <div id="app">
    <router-link replace to="/login" tag="button">Login页面</router-link>
    <router-link replace to="/home" tag="button">Home页面</router-link>


    <router-link replace to="/user" tag="button">user页面</router-link>


    <button @click="pushShow()">push查看</button>
    <button @click="replaceShow()">replace查看</button>

    <keep-alive :include="['HomeIndex','MyComponent']">
      <router-view ></router-view>
    </keep-alive>
    
  </div>
</template>

<script>
export default {
  name: "App",
  components: {},
  methods: {
    pushShow() {
      // alert("push查看");
      this.$router.push({
        name:"My",
        params: {
          id: "88",
          name: "周润发",
        }
      })
    },
    replaceShow() {
      // alert("replace查看");
      this.$router.replace({
        name:"My",
        params: {
          id: "99",
          name: "周星驰",
        }
      })
    }
  }
};
</script>

<style>

</style>